
// TaxiInfo.java

package com.ruoyi.hospital.entity.check;

import com.ruoyi.service.domain.ServiceOrderotherpay;

import java.util.ArrayList;
import java.util.List;

/**
 * 行程明细
 */
@lombok.Data
public class CheckOthersInfo {
    /**
     * 其他费用总额
     */
    private Long othersCharge = 0L;

    private List<CheckOthersInfoFromNur> othersInfoFromNurList;

    public void init(List<ServiceOrderotherpay> orderotherpayList) {
        if (orderotherpayList == null){
            this.setOthersInfoFromNurList(new ArrayList<CheckOthersInfoFromNur>());
        }
        for (ServiceOrderotherpay orderotherpay : orderotherpayList) {
            if (orderotherpay.getOrderotherpayUseFlag().equals("0")) {
                CheckOthersInfoFromNur othersInfoFromNur = new CheckOthersInfoFromNur();
                othersInfoFromNur.setId(orderotherpay.getOrderotherpayId());
                othersInfoFromNur.setDesc(orderotherpay.getOrderotherpayDesc());
                othersInfoFromNur.setCost(orderotherpay.getOrderotherpayPrice());
                this.othersCharge = this.othersCharge + orderotherpay.getOrderotherpayPrice();
                this.getOthersInfoFromNurList().add(othersInfoFromNur);
            }
        }
    }
}
